package com.ruoyi.library.api.factory;

import com.ruoyi.common.core.domain.R;
import com.ruoyi.library.api.ISysDictDataService;
import com.ruoyi.library.api.domain.SysDictData;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.cloud.openfeign.FallbackFactory;
import org.springframework.stereotype.Component;
import org.springframework.web.bind.annotation.RequestBody;

import java.util.List;

/**
 * 用户服务降级处理
 * 
 * @author ruoyi
 */
@Component
public class ISysDictDataFallbackFactory implements FallbackFactory<ISysDictDataService>
{
    private static final Logger log = LoggerFactory.getLogger(ISysDictDataFallbackFactory.class);

    @Override
    public ISysDictDataService create(Throwable throwable)
    {
        log.error("消息服务调用失败:{}", throwable.getMessage());
        return new ISysDictDataService()
        {
            @Override
            public List<SysDictData> selectDictDataList(@RequestBody SysDictData dictData) {
                return null;
            }
        };
    }
}
